<template>
    <div>

        <h1>欢迎来到用户中心</h1>

        <van-collapse v-model="activeNames" style="width:200px" v-for="i in zylist" :key="i.id">
            <van-collapse-item  :title="i.name" >
              <p v-for="j in i['son']" :key="j">
                <router-link v-if="i.id==j.pid" name="1" :to="{path:j['url']}">{{j.name}}</router-link>
                <router-link v-else to=""></router-link>
              </p>
            </van-collapse-item>
        </van-collapse>

        <van-button to="zlogin" text="去登录"/>


    </div>
</template>

<script>


export default{

    data () {
        return {
            activeNames: ['1'],
            zylist: [],
            uid: localStorage.getItem('uid')
            
        }
    },
    methods: {
        get_res() {
            maxios('/get_zy?uid=' + this.uid, 'get').then(res => {
                this.zylist = res.list
      
            })
    
        },
    
        gogo(url) {
      
            alert(url)
    
        }

    },

    mounted () {
        this.get_res()
    }
}
</script>


<style>
@import url("../assets/style.css");
</style>